export let validateUserName = async (_rule: any, value: string) => {
  if (value.trim() === '') {
    return Promise.reject('请填写用户名')
  } else if (!/^\w{5,20}$/.test(value)) {
    return Promise.reject('格式错误')
  } else {
    return Promise.resolve()
  }
}
export let validatePassword = async (_rule: any, value: string) => {
  if (value.trim() === '') {
    return Promise.reject('请填写密码')
  } else if (!/^\w{5,20}$/.test(value)) {
    return Promise.reject('密码格式错误')
  } else {
    return Promise.resolve()
  }
}
